package com.baitengsoft.patentapimonitor.api.service.impl;

import com.baitengsoft.patentapimonitor.api.dao.SysAdminUserTokenDao;
import com.baitengsoft.patentapimonitor.api.dao.SysAdmininfoDao;
import com.baitengsoft.patentapimonitor.api.dao.WebUserDao;
import com.baitengsoft.patentapimonitor.api.dao.WebUserTokenDao;
import com.baitengsoft.patentapimonitor.api.entity.SysAdminUserTokenEntity;
import com.baitengsoft.patentapimonitor.api.entity.SysAdmininfoEntity;
import com.baitengsoft.patentapimonitor.api.entity.WebUserTokenEntity;
import com.baitengsoft.patentapimonitor.api.entity.WebUserinfoEntity;
import com.baitengsoft.patentapimonitor.api.service.ShiroService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ShiroServiceImpl implements ShiroService {
    @Autowired
    private WebUserDao webUserDao;
    @Autowired
    private WebUserTokenDao webUserTokenDao;
    @Autowired
    private SysAdmininfoDao adminUserDao;
    @Autowired
    private SysAdminUserTokenDao adminUserTokenDao;

    @Override
    public WebUserTokenEntity queryWebUserByToken(String token) {
        return webUserTokenDao.queryByToken(token);
    }

    @Override
    public WebUserinfoEntity queryWebUser(Long userId) {
       return webUserDao.queryObject(userId);
    }


    @Override
    public SysAdminUserTokenEntity queryAdminUserByToken(String token) {
        return adminUserTokenDao.queryByToken(token);
    }

    @Override
    public SysAdmininfoEntity queryAdminUser(Long userId) {
        return adminUserDao.queryObject(userId);
    }
}
